package com.abc.service;

import com.abc.entity.Chengji;
import com.abc.mapper.ChengjiMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class ChengjiService {

    @Autowired
    private ChengjiMapper chengjiMapper;

    public List<Map<String,Object>> findAllChengji(String jsid ){
        return chengjiMapper.findAllChengji(jsid);
    } public List<Map<String,Object>> findXsAllChengji(String jsid ){
        return chengjiMapper.findXsAllChengji(jsid);
    }
    public String addChengji(Chengji chengji){
        Chengji chengji1 = chengjiMapper.findByChengjiId(chengji);
        if(chengji1==null){
            chengjiMapper.insertChengji(chengji);
            return "成绩添加完成";
        }else{
            chengjiMapper.updateChengji(chengji);
            return "成绩修改完成";
        }
    }
}
